package com.cn.pack.controller;

import com.cn.pack.Student;
import com.cn.pack.feign.HelloFeignService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping(path = "/hello")
public class HelloFeignController {

    @Autowired
    private HelloFeignService helloFeignService;

    @RequestMapping(path = "/say")
    public String say(@RequestBody Student student) {
        System.out.println("student = " + student.toString());
        Student query = helloFeignService.query(student);
        System.out.println("query = " + query.toString());
        return query.toString();
    }
}
